package top.bingoz.wanandroid.di.component

import android.app.Application
import top.bingoz.wanandroid.AppApplication
import top.bingoz.wanandroid.di.module.ActivityBindingModule
import top.bingoz.wanandroid.di.module.ApplicationModule
import top.bingoz.wanandroid.di.module.HttpModule
import dagger.BindsInstance
import dagger.Component
import dagger.android.AndroidInjector
import dagger.android.support.AndroidSupportInjectionModule
import javax.inject.Singleton

/**
 * @author su
 * @date 2018/7/27
 * @description
 */
@Singleton
@Component(modules = [HttpModule::class, ApplicationModule::class, ActivityBindingModule::class, AndroidSupportInjectionModule::class])
interface AppComponent : AndroidInjector<AppApplication> {

    @Component.Builder
    interface Builder {

        @BindsInstance
        fun application(application: Application): AppComponent.Builder

        fun build(): AppComponent
    }
}